#include <stdio.h>

#include "xlcomm/net/event_loop.h"
using namespace xlcomm;

class Foo {
 public:
  Foo(int n) : num_(n) {}
  void print(net::EventLoop* loop, int* num) {
    *num = *num + num_;
    loop->Quit();
  }

 private:
  int num_;
};

int main() {
  net::EventLoop loop;
  int num = 2;
  Foo foo(3);
  loop.RunAfter(1, std::bind(&Foo::print, &foo, &loop, &num));
  loop.Loop();
  printf("num=%d\n", num);
}